
TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/TESTS_ENVIRONMENT

AM_CPPFLAGS = \
	-I$(srcdir)/../src \
	-D_REFLECXX_FILE_=`echo $* | sed -e 's/[^a-zA-Z0-9_]/_/g'`

include $(top_srcdir)/src/reflecxx.am

LDADD = \
	$(top_builddir)/src/libreflecxx.a \
	libreflecxx-info.a

check_LIBRARIES = libreflecxx-info.a

libreflecxx_info_a_SOURCES =
libreflecxx_info_a_LIBADD = \
	hello-world-reflecxx-info.o \
	stats-reflecxx-info.o \
	config-file-reflecxx-info.o \
	test-arrays-reflecxx-info.o \
	test-enums-reflecxx-info.o \
	test-scan-reflecxx-info.o \
	test-struct-reflecxx-info.o \
	test-function-reflecxx-info.o \
	test-cxx-reflecxx-info.o

hello-world-reflecxx-info.c: $(hello_world_OBJECTS)

hello_world_SOURCES = hello-world.c

stats-reflecxx-info.c: $(stats_OBJECTS)

stats_SOURCES = stats.c

config-file-reflecxx-info.c: $(config_file_OBJECTS)

config_file_SOURCES = config-file.c

test-enums-reflecxx-info.c: $(test_enums_OBJECTS)

test-struct-reflecxx-info.c: $(test_struct_OBJECTS)

test-arrays-reflecxx-info.c: $(test_arrays_OBJECTS)

test-function-reflecxx-info.c: $(test_function_OBJECTS)

test-scan-reflecxx-info.c: $(test_scan_OBJECTS)

test-cxx-reflecxx-info.cc: $(test_cxx_OBJECTS)

test_cxx_SOURCES = test-cxx.cc

if HAVE_CINVOKE
test-cinvoke-reflecxx-info.c: $(test_cinvoke_OBJECTS)

test_cinvoke_SOURCES = test-cinvoke.c
test_cinvoke_LDADD = \
	$(LDADD) \
	test-cinvoke-reflecxx-info.o \
	-lcinvoke \
	-ldl

CINVOKE_TESTS = test-cinvoke
else
CINVOKE_TESTS =
endif

check_PROGRAMS = \
	$(CINVOKE_TESTS) \
	hello-world \
	stats \
	config-file \
	test-print \
	test-arrays \
	test-enums \
	test-escape \
	test-scan \
	test-struct \
	test-function \
	test-cxx

check_SCRIPTS = \
	examples.sh

TESTS = \
	$(CINVOKE_TESTS) \
	test-escape \
	test-print \
	test-scan \
	test-arrays \
	test-enums \
	test-struct \
	test-function \
	test-cxx \
	examples.sh

EXTRA_DIST = \
	examples.sh

CLEANFILES = *-reflecxx-info.c *.tmp
